<div class="module-setting">
    <ol class="breadcrumb fn-clearfix">
        <li>网站维护</li>
        <li>算力奖励配置</li>
    </ol>
    <div class="ui-box">
        <form class="form-horizontal" role="form">
            <div class="form-group">
                <label for="assetCode" class="control-label">获得奖励冻结配置</label>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">指定用户</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" ng-model="vm.form.USERID" maxlength="256" placeholder="请输入用户UID" />
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">配置币种</label>
                <div class="col-sm-3">
                    <select class="form-control" ng-model="vm.form.ASSETCODES" id="assetCode2">
                        <option value="">请选择</option>
                        <option value="{{item.value}}"
                                ng-repeat="item in $root.$coinList">
                            {{item.label}}
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">冻结百分比</label>
                <div class="col-sm-3">
                    <input type="text" class="form-control" ng-model="vm.form.LOCK_NUM_PERCENT" maxlength="256" placeholder="请输入冻结百分比（0.1 - 1）" />
                </div>
                <div class="col-sm-6">
                    <span class="description">发放奖励冻结的比例(0-1)默认为0.4,(用户获得的活动奖励比如 10IEP ，直接到账6个IEP，冻结4个)</span>
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">交易统计天数</label>
                <div class="col-sm-3">
                    <span ng-if="vm.totalInfo.isenable==='LOCK'">
                    <input type="text" class="form-control" ng-model="vm.form.TRADE_COUNT_DAYS" maxlength="256" disabled placeholder="请输入交易统计天数" />
                    </span>
                    <span ng-if="vm.totalInfo.isenable==='UNLOCK'">
                        <input type="text" class="form-control" ng-model="vm.form.TRADE_COUNT_DAYS" maxlength="256" placeholder="请输入交易统计天数" />
                    </span>
                </div>
                <div class="col-sm-1">
                    <span class="btn btn-danger" ng-click="vm.lock('UNLOCK')" ng-model="vm.form.UNLOCK" value="LOCK" ng-if="vm.totalInfo.isenable==='LOCK'">锁定</span>
                    <span class="btn btn-success" ng-click="vm.unlock('LOCK')" ng-model="vm.form.LOCK" value="UNLOCK" ng-if="vm.totalInfo.isenable==='UNLOCK'">解锁</span>
                </div>
                <div class="col-sm-6">
                    <span class="description">统计用户 （默认30天）的交易总额，进行是否解除奖励冻结</span>
                </div>
            </div>
            <div class="form-group">
                <label for="webUrl" class="col-sm-2 control-label">解冻条件</label>
                <div class="col-sm-1">
                    <input type="text" class="form-control" ng-model="vm.UNLOCK_NUM_PERCENT[0]" maxlength="256" placeholder="请输入分子" />
                </div>
                <div class="col-sm-1">
                    <input type="text" style="text-align: center;" class="form-control" value="/" disabled />
                </div>
                <div class="col-sm-1">
                    <input type="text" class="form-control" ng-model="vm.UNLOCK_NUM_PERCENT[1]" maxlength="256" placeholder="请输入分母" />
                </div>
                <div class="col-sm-6">
                    <span class="description">
                        客户冻结IEP数量假设为n:解冻条件: （默认为 1/30）  a.(30/5n,10.1)*（1/30）   b.(当天未冻结iep数量/n,最大为1最小为0.1)*（1/30）
                    </span>
                </div>

            </div>
            <div class="form-group ui-input-select" style="margin-left:290px;">
                <button type="submit"
                        style="width: 300px;"
                        class="btn btn-primary form-btn"
                        ng-click="vm.submit()">添加</button>
            </div>
        </form>
    </div>

</div>
<div class="module-trade">
    <div class="panel panel-warning">
        <div class="panel-body">
            <form class="form-inline ui-form" role="form">
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">指定用户：</label>
                    <input type="text" class="form-control " placeholder="UID" ng-model="vm.condition.uid" id="record-uid">
                </div>
                <div class="form-group ui-input-select">
                    <label for="record-uid" class="control-label f-12">币种选择：</label>
                    <select class="form-control" ng-model="vm.condition.assetCode" ng-change="vm.changeAssetCode()">
                        <option ng-repeat="item in $root.$coinList" ng-value="item.value" >{{item.label}}</option>
                    </select>
                </div>

                <div class="form-group">
                    <span class="description" style="font-size: 16px;"></span>
                </div>
                <div class="form-group">
                    <button type="submit"  class="btn btn-primary" ng-click="vm.fetchList()">搜索</button>

                </div>


            </form>
        </div>
    </div>
</div>
<div class="module-trade">
    <div class="form-group">
        <label for="assetCode" class="control-label">当前奖励冻结配置<!--<span style="color:red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*当前列表对象为搜索对象，默认对象为所有用户</span>--></label>
    </div>
    <div class="ui-box">
        <table class="table table-striped table-hover table-bordered">
            <thead>
            <tr>
                <th>配置币种</th>
                <th>配置对象</th>
                <th>冻结百分比</th>
                <th>交易统计天数</th>
                <th>解冻条件</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in vm.list" ng-if="vm.isLoading === false && vm.list.length > 0">
                <td>{{item.assetCode}}</td>
                <td>{{item.uid}}</td>
                <td>{{item.percentageFreezing}}</td>
                <td>{{item.transactionDay}}</td>
                <td>{{item.percentageThaw}}</td>
                <td ng-class="{
                        greentradedetail:(item.dictStatus=='UNLOCK'),
                        redtradedetail:(item.dictStatus=='LOCK')}">
                    {{item.dictStatus == 'LOCK' ? '锁定' : '已解锁'}}&emsp;&emsp;
                </td>
                <td>
                    <a href="javascript:;" ng-click="vm.showUserdict(item.id)">修改</a>
                    <a href="javascript:;"
                       ng-click="vm.deleteAllocationProportion(item.id)">删除</a>
                </td>
            </tr>
            </tbody>
        </table>

        <div class="ui-pager-box" ng-if="vm.totalNum > 0">
            <ul uib-pagination previous-text="上一页" next-text="下一页" first-text="首页" last-text="尾页" total-items="vm.totalNum" ng-model="vm.condition.pageNo"
                max-size="5" items-per-page="vm.pageSize || 10" align="right" class="pagination" boundary-links="true" ng-change="vm.pageChanged()"
                rotate="false"></ul>
        </div>
    </div>
</div>
